Add a filter to the New Data Source modal #789
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Adds a filter to make it easier to find the data source you're looking
for in the New Data Source modal found in both the lower pane when
creating an app, and the Data Source page when in Home.
The filtering ignores case and diacritics, but is not a fuzzy filter as
I thought that would be too confusing for a simple search like this.
The localeContains function comes from StackOverflow user Jan Turoň, https://stackoverflow.com/a/69623589/1394698
The function sacrifices complete compatibility with the localeCompare
function for a simplified diacritics check which should suffice for the
majority of lowcoder use cases. I initially tried to get the npm library
locale-includes working, but Vite really doesn't like it, and it failed
to compile no matter what I tried.
Types of changes
What types of changes does your code introduce to Lowcoder?
Put an
x
in the boxes that apply.Checklist
You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
Put an
x
in the boxes that apply.I have added tests that prove my fix is effective or that my feature worksI am unable to find any existing tests for this subproject, and I'm not sure if it's possible to add UI tests like this?Any dependent changes have been merged and published in downstream modulesManual testing:
I did manual testing of the filter including with diacritics:
No Filter Applied
Filters with normal ASCII
Filters with ASCII finds Data Sources with diacritics
Further comments
I plan on adding a lot more AWS plugins and as a result, being able to search in the modal will probably be very necessary. I also struggle sometimes reading through all the items.